﻿using System;
using System.Collections.Generic;
using STeaL.Functional;

namespace STeaL.Algorithm {
  public static partial class ICollectionExtensions {
#region size
    /// <summary>
    /// number of items in 'collection'
    /// </summary>
    public static int size<T>(this ICollection<T> collection) {
      return collection.Count;
    }

#endregion
#region empty
    /// <summary>
    /// return true if no item in 'collection'
    /// </summary>
    public static bool empty<T>(this ICollection<T> collection) {
      return collection.Count == 0;
    }

#endregion
#region clear
    /// <summary>
    /// clear 'collection'
    /// </summary>
    public static void clear<T>(this ICollection<T> collection) {
      collection.Clear();
    } 

#endregion
  }

}
